package com.wisezone.studentmanger.servlet;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MyServlet extends HttpServlet {

	@Override
	public void init(ServletConfig config) throws ServletException {
		String userName = config.getInitParameter("username");
		String passWord = config.getInitParameter("password");
		System.out.println("init >>>userName :"+userName+" passWord:"+passWord);
	}
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.getWriter().append("Served at: ").append(request.getContextPath());

		System.out.println("动态web工程学习");
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request, response);
	}
	
	@Override
	public void destroy() {
		//
	}

}
